package cn.edu.javaweb.superServlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.javaweb.utils.DBUtil;

@WebServlet("/HiddenComment")
public class HiddenComment extends HttpServlet {
	private static final long serialVersionUID = 1L;
	DBUtil db;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		System.out.println("禁用操作");
		String id = request.getParameter("id");
		System.out.println(id); 
		db=new DBUtil();
		
		String SQL = "UPDATE comment SET hidden=1 WHERE id='"+id+"'";
		int result=db.update(SQL);
		
	
		System.out.println(SQL);
		request.getRequestDispatcher("/SelectComment").forward(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doGet(request, response); 
	}

}
